<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>就业信息系统管理</title>
    <link rel="stylesheet" type="text/css" href="/static/admin/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/main.css">
    <script type="text/javascript" src="/static/admin/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.form.min.js"></script>
    <script src="/static/admin/tinymce/js/tinymce/tinymce.min.js"></script>
    <script src="/static/admin/js/tinymce_setup.js"></script>
    <script src="/static/admin/js/news_edit_detail.js"></script>
</head>
<body>
<div class="breadcrub">
    当前位置：用户信息管理>修改用户信息
</div>
<div class="pannel">
    <form class="news_edit">
        <h3 class="review_title">用户信息编辑</h3>
        <div class="form_group">
            <label>用户名：</label>
            <input type="text" class="input_txt1" value="{{ user.username }}" id="username">
        </div>
        <div class="form_group">
            <label>手机号：</label>
            <input type="text" class="input_txt1" value="{{ user.phone }}" id="phone">
        </div>
        <div class="form_group">
            <label>管理员：</label>
            <input type="text" class="input_txt1" value="{{ user.is_admin }}" id="is_admin">
        </div>
        <div class="form_group indent_group line_top">
            <input id="submit" type="submit" value="确定" class="confirm">
            <input type="button" value="取消" class="cancel" onclick="cancel()">
        </div>
    </form>
</div>


<!-- jQuery -->
<script src="/static/register/js/jquery.min.js"></script>
{#<script src="/static/register/js/jquery-1.12.4.min.js"></script>#}
<script src="/static/register/js/jquery.form.min.js"></script>
<script src="/static/register/js/jquery.pagination.min.js"></script>
<!-- Bootstrap -->
<script src="/static/register/js/bootstrap.min.js"></script>
<!-- Placeholder -->
<script src="/static/register/js/jquery.placeholder.min.js"></script>
<!-- Waypoints -->
<script src="/static/register/js/jquery.waypoints.min.js"></script>
<!-- Main JS -->
<script src="/static/register/js/main.js"></script>

{# 修改 #}
<script>
    $(function () {
        //点击发送ajax请求
        $('#submit').click(function () {
            username = $('#username').val();
            phone = $('#phone').val();
            is_admin = $('#is_admin').val();
            {#job_monthly_pay = $('.input_txt4').val();#}
            {#job_education = $('.input_txt5').val();#}
            {#job_address = $('.input_txt6').val();#}
            {#job_count = $('.input_txt7').val();#}
            {#create_time = $('.input_txt8').val();#}
            {#job_major = $('.input_txt9').val();#}


            var params = {
                "username": username,
                "phone": phone,
                "is_admin": is_admin,
                {#"job_monthly_pay": job_monthly_pay,#}
                {#"job_education": job_education,#}
                {#"job_address": job_address,#}
                {#"job_count": job_count,#}
                {#"create_time": create_time,#}
                {#"job_major": job_major,#}
            };

            $.ajax({
                url: "/changeuser_info/" + {{ user.id }}+"/",
                type: "post",
                contentType: "application/json",
                // 响应数据的格式
                dataType: "json",
                data: JSON.stringify(params),
                success: function (resp) {
                    if (resp.code == "0") {
                        // 刷新当前界面
                        history.go(-1).reload();
                        {#location.reload();#}
                        {#window.top.location = "/index";#}
                    } else {
                        alert(resp.errmsg);
                        {#$("#register-err").html(resp.errmsg);#}
                        {#$("#register-err").show();#}
                        {#$(".get_pic_code").attr("src", "/member/image_code?id=" + Math.random())#}
                    }
                }
            })
        });
    })
</script>


</body>
</html>
